package model;

import java.util.Date;
import java.util.Observable;

import dao.Customer;
import dao.Waiting;

public class ModelWaiting extends Observable{
	private Waiting waiting = new Waiting();	
				
	public void update(Waiting waiting){
		if(waiting != null){
			this.setOID(waiting.getOID());
			this.setDeService(waiting.getDeService());			 
			this.setDhWaiting(waiting.getDhWaiting());
			this.setCustomer(waiting.getCustomer());
			
			setChanged();
			notifyObservers();
		}
	}
	
	public Waiting getWaiting() {
		return waiting;
	}
		
	public int getOID() {
		return waiting.getOID();
	}
	public void setOID(int oID) {
		waiting.setOID(oID);
	}
	public String getDeService() {
		return waiting.getDeService();
	}

	public void setDeService(String deService) {
		waiting.setDeService(deService);
	}

	public Date getDhWaiting() {
		return waiting.getDhWaiting();
	}

	public void setDhWaiting(Date dhWaiting) {
		waiting.setDhWaiting(dhWaiting);
	}

	public Customer getCustomer() {
		return waiting.getCustomer();
	}

	public void setCustomer(Customer customer) {
		waiting.setCustomer(customer);
		setChanged();
		notifyObservers();
	}
	
	public String toString(){
		return waiting.getDhWaiting() + " - " + waiting.getCustomer().getNmCustomer();
	}	
}
